cmake_minimum_required (VERSION 2.6)

project (Openni2Player)
find_package( OpenCV REQUIRED PATHS $ENV{OPENCV_NEW_2012} /usr NO_DEFAULT_PATH)


if( UNIX )
    message(STATUS "platform: UNIX")
    include_directories ( ${EIGEN_INCLUDE_DIRS} )

	include_directories ( "/usr/local/include/eigen3" )
	include_directories ( "/usr/include/ni" )
    set( FLANN_LIBRARY "/usr/local/lib64/libflann.so" )
elseif( WIN32 )
    message(STATUS "platform: Windows")

	include_directories ( $ENV{OPENNI2_INC} )
    	include_directories ( $ENV{FREEGLUT_INCLUDE_DIR} )
	include_directories ( $ENV{OPENCV_NEW_2012}/include )
	include_directories ( $ENV{GLEW_INCLUDE_DIR} )

	link_directories ( $ENV{FREEGLUT_LIB_DIR} )
	link_directories ( $ENV{OPENNI2_LIB} )
	link_directories ( $ENV{GLEW_LIB_DIR} )   
endif()


file(GLOB HEADERS "[a-zA-Z]*.h" "[a-zA-Z]*.hpp"   )
message(STATUS "header names: ${HEADERS}")
file(GLOB SOURCES "[a-zA-Z]*.cpp")
message(STATUS "source names: ${SOURCES}")

add_executable( Openni2Player ${HEADERS} ${SOURCES} )
target_link_libraries( Openni2Player GLU32 opengl32 OpenNI2 glew32)
 
